package com.chushouya.order.constants;



import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

public enum OrderPlatformEnum implements IEnum<String> {
    //微信小程序
    WEAPP("weapp", "微信小程序"),
    //支付宝小程序
    ALIPAY("alipay", "支付宝小程序"),
    //支付宝回收
    COMMERCE("commerce", "支付宝回收"),
    //百度小程序
    SWAN("swan", "百度小程序"),
    //头条小程序
    TT("tt", "头条小程序"),
    H5("h5", "H5"),

    KUAISHOU("ks", "快手小程序"),
    APP("app", "APP"),

    ANDROID("android", "安卓"),

    IOS("ios", "苹果"),

    KEFU("kefu", "客服"),
    //苏宁
    SUNING("suning", "苏宁小程序"),
    CMCC("cmcc", "移动小程序"),
    PARTNER("partner", "合作商"),

    OFFLINE_STORE("offlineStore", "线下门店"),
    MEITUAN("meituan", "美团小程序"),
    ;


    private String value;

    private String desc;

    OrderPlatformEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(String status) {
        for (OrderPlatformEnum thisEnum : OrderPlatformEnum.values()) {
            if (Objects.equals(thisEnum.value, status)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }

    @Override
    public String value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
